<template>
	<div>
		<div style="font-size:18px;">优惠劵详情</div>
		<hr>
		<br>

		<el-table :data="list" border @selection-change="$handleSelectionChange">
			<el-table-column prop="batchNum" label="批次编号" min-width="200px"></el-table-column>
			<el-table-column prop="expirationDateName" label="过期时间" min-width="100px"></el-table-column>
			<el-table-column prop="typeName" label="类型" min-width="70px"></el-table-column>
			<el-table-column prop="stateName" label="状态" min-width="80px"></el-table-column>
			<el-table-column prop="couponCondition" label="使用条件" min-width="80px"></el-table-column>
			<el-table-column prop="coupon" label="优惠金额" min-width="60px"></el-table-column>
			<el-table-column prop="remarks" label="备注" min-width="140px"></el-table-column>
		</el-table>
		<!--分页组件 -->
		<div class="pagination">
			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :page-sizes="$page.selectPage" :page-size="$page.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="$page.total">
			</el-pagination>
		</div>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				//table数据
				list: [],
				//当前行数据
				rowData: {},
				//所有URL
				urls: {
					getList: "/Coupon/list",
				},
			};
		},
		mounted() {
			this.getPageData();
		},
		methods: {
			//改变分页后刷新
			getPageData() {
				this.getList();
			},
			//获取优惠劵匹次信息
			getList() {
				var that = this;
				this.$page.param = {
					batchNum:this.dataSave.get("couponBatchInfoId")
					};
				this.myajax(this.urls.getList, this.$page,function(res) {
					var data = res.data;
					that.list = data.list;
					that.$page.total = data.total;
				})
			},

			handleCurrentChange(val) { //翻页
				this.$handleCurrentChange(val);
				this.getPageData();
			},
			handleSizeChange(val) { //每页数量
				this.$handleSizeChange(val);
				this.getPageData();
			},
			handleSelectionChange(val) {

			}
		}
	};
</script>
<style scoped>
	.input_edit {
		width: 200px;
		float: left;
		margin-right: 10px;
	}
	
	.cell {
		padding: 0 5px !important;
		overflow: auto;
	}
</style>